// 商品管理模块
import request from "@/utils/request.js";  //引入增强过后的axios

// 获取商品分类名称
export const categories = function (params) {
    return request({
        method: 'get',
        url: '/goods/categories',
        params,
    });
}

// 添加商品
export const goodsAdd = function (data) {
    return request({
        method: 'post',
        url: '/goods/add',
        data,
    });
}

// 获取商品列表
export const goodsList = function (params) {
    return request({
        method: 'get',
        url: '/goods/list',
        params,
    });
}

// 删除商品列表
export const goodsDel = function (params) {
    return request({
        method: 'get',
        url: '/goods/del',
        params,
    });
}

// 修改商品
export const goodsEdit = function (data) {
    return request({
        method: 'post',
        url: '/goods/edit',
        data,
    });
}

// 获取分类列表
export const cateList = function (params) {
    return request({
        method: 'get',
        url: '/goods/catelist',
        params,
    });
}

// 删除分类
export const delCate = function (params) {
    return request({
        method: 'get',
        url: '/goods/delcate',
        params,
    });
}

// 添加分类
export const addCate = function (data) {
    return request({
        method: 'post',
        url: '/goods/addcate',
        data,
    });
}

// 修改分类
export const editCate = function (data) {
    return request({
        method: 'post',
        url: '/goods/editcate',
        data,
    });
}